<?php
/*
 * related product tpl
 */
if (count($data) > 0) :
?>
    <h3 class="title"><?php print t('Similar products') ?></h3>
    <ul>
    <?php
    foreach ($data as $product) {
        $link = url('node/' . $product->nid);
        $image = field_file_load($product->fid);
        $image_path = base_path() . imagecache_create_path('product_list', $image['filepath']);

        $product->vid = $product->nid;
        $product_info = uc_product_load($product);
        $price = uc_price( array('price'=>$product_info->list_price, 'qty'=>1), array('revision'=>'formatted') );
    ?>
        <li>
            <div class="productItem">
                <a href="<?php print $link ?>"><img src="<?php print $image_path ?>" /></a>
                <span class="title"><?php print $product->title; ?></span>
                <span class="price"><?php print $price; ?></span>
            </div>
        </li>
    <?php } ?>
</ul>
<?php endif; ?>

